package cn.ilikes.tools.hbase.jpa.indexs;

import java.util.List;

import cn.ilikes.tools.hbase.jpa.clients.nodes.Node;
import cn.ilikes.tools.hbase.jpa.metadatas.IEntityMetaData;

public interface IndexClient {

	public abstract boolean entityExistsByEntity(Node node) throws IndexManagerException;

	public abstract void remove(Node node) throws IndexManagerException;

	public abstract void update(Node node) throws IndexManagerException;

	public abstract void add(Node node) throws IndexManagerException;

	public abstract <V> List<V> search(String query, IEntityMetaData metadata) throws IndexManagerException;

	public abstract <V> List<V> search(String query, int start, int count, IEntityMetaData metadata) throws IndexManagerException;

	public abstract <V> List<V> search(String query, int start, int count, IEntityMetaData metadata, boolean fetchRelation) throws IndexManagerException;

	/**
	 * Flushes out the indexes, keeping RAM directory open.
	 */
	public abstract void flush(IEntityMetaData metadata) throws IndexManagerException;

	/**
	 * Closes the transaction alongwith RAM directory.
	 */

	public abstract void commit(IEntityMetaData metadata) throws IndexManagerException;

	public abstract void close() throws IndexManagerException;

	public abstract void flush();

	public abstract boolean isOpen();

}